package com.huarui.payInvoice.action;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.log4j.Logger;
import org.ewaf.framework.action.BaseAction;
import org.ewaf.framework.task.Engine;
import org.ewaf.framework.task.Handler;


import com.opensymphony.xwork2.Action;

public class PayInvoiceButtonAction extends BaseAction{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@SuppressWarnings("unused")
	private static final Logger logger = Logger.getLogger(PayInvoiceButtonAction.class);
	private Engine payInvoiceButtonEngine;
	private String typeId;
	private boolean mask;
	private Map<String,Object> buttonsMap=new HashMap<String, Object>();
	
	public String findButtons(){
		List<Handler> handlers = payInvoiceButtonEngine.getHandlers(typeId);
		if(handlers == null) {
			handlers = new ArrayList<Handler>();
		}
		buttonsMap.put("buttons", handlers);
		//buttonsMap.put("mask",mask);
		return Action.SUCCESS;
	}
	

	public boolean isMask() {
		return mask;
	}




	public void setMask(boolean mask) {
		this.mask = mask;
	}




	public void setPayInvoiceButtonEngine(Engine payInvoiceButtonEngine) {
		this.payInvoiceButtonEngine = payInvoiceButtonEngine;
	}


	public String getTypeId() {
		return typeId;
	}


	public void setTypeId(String typeId) {
		this.typeId = typeId;
	}


	public Map<String, Object> getButtonsMap() {
		return buttonsMap;
	}


	public void setButtonsMap(Map<String, Object> buttonsMap) {
		this.buttonsMap = buttonsMap;
	}
	
}
